package com.kggs.springsnmp;

/**
 * @author : fjc.dane@gmail.com
 * @createtime : 2021/8/19 16:32
 */
public enum IndicatorOIDName {
    //网络接口信息描述  网络接口类型 接口发送和接收的最大IP数据报[BYTE] 接口当前带宽[bps] 接口的物理地址   接口当前操作状态[up|down]
    TEST("test", "测试", ".1.3.6.1.2.1.2.2.1.2," +
            ".1.3.6.1.2.1.2.2.1.3," +
            ".1.3.6.1.2.1.2.2.1.4," +
            ".1.3.6.1.2.1.2.2.1.5" +
            ".1.3.6.1.2.1.2.2.1.6," +
            ".1.3.6.1.2.1.2.2.1.8"),

    CPURATE("cpuRate", "总cpu占用率", "1.3.6.1.2.1.25.3.3.1.2"), //y
    DISK_USE_RATE("diskUseRate", "磁盘使用率", "1.3.6.1.2.1.25.2.3.1.6"), //y ，前-总，后-已使用
    //1:Physical memory ;3:Virtual memory; 6:Memory buffers;7:Cached memory
    PHY_MEM_USE_PERCENT("phyMemUsePercent", "物理内存利用率", "1.3.6.1.2.1.25.2.3.1.5,1.3.6.1.2.1.25.2.3.1.6"),
    UP_STREAM("upStream", "上行流量监控(专用)", ".1.3.6.1.2.1.2.2.1.16"),
    DOWN_STREAM("downStream", "下行流量监控(专用)", ".1.3.6.1.2.1.2.2.1.10"),
    STREAM_SUM("streamSum", "上下行流量总和", ".1.3.6.1.2.1.2.2.1.10,.1.3.6.1.2.1.2.2.1.16"),
    //网络接口信息描述 网络接口类型
    NETWORK_INTERFACE("networkInterface", "网络接口", ".1.3.6.1.2.1.2.2.1.2,.1.3.6.1.2.1.2.2.1.3");

    private String name;
    private String mes;
    private String oid;

    IndicatorOIDName(String name, String mes, String oid) {
        this.name = name;
        this.mes = mes;
        this.oid = oid;
    }

    public static IndicatorOIDName getByName(String name) {
        for (IndicatorOIDName IndicatorOIDName : IndicatorOIDName.values()) {
            if (name.startsWith(IndicatorOIDName.getName())) {
                return IndicatorOIDName;
            }
        }
        throw new RuntimeException("不支持类型 IndicatorOIDName.name=" + name);
    }


    public String getName() {
        return name;
    }

    public String getMes() {
        return mes;
    }

    public String getOid() {
        return oid;
    }
}
